<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<%@ include file="../common/common.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>新增</title>
</head>
<body>
	<form action="${ctx}/item/add" method="post" enctype="multipart/form-data">
		标题:<input type="text" name="title"/><br/>
		价格:<input type="text" name="price"/><br/>
		数量:<input type="text" name="num" /><br/>
		备注:<textarea rows="4" cols="40" name="remark"></textarea><br/>
		图片:<input type="file" name="picFile" /><button type="button" id="addFile">添加</button>
		<div id="picDiv"></div>
		<input type="submit" value="保存"/>
		<input type="reset" value="重置">
	</form>
</body>
<script type="text/javascript">
$(function(){  
	/** 添加文件框*/
	$("#addFile").click(function(){
		var spanFile = $("<span><input type='file' name='picFile'><button type='button' name='delFileName' onclick='delFile(this)'>删除</button><span><br/><br/>");
		$("#picDiv").append(spanFile);
	});
	/**删除文件框*/
	$("button[name='delFileName']").live('click', function() {
		$(this).parent().remove();
	});
}); 
</script>
</html>